//
//  CommonDefine.h
//  golfMaster
//
//  Created by MAC_XXK on 14-7-8.
//  Copyright (c) 2014年 宋鹏程. All rights reserved.
//

#ifndef golfMaster_CommonDefine_h
#define golfMaster_CommonDefine_h

/********************server address********************/

#define FOR_RELEASE//打开：正式环境；注释：测试环境

#ifdef  FOR_RELEASE

// 正式版服务器
#define SERVER_PREFIX   (@"http://sheying.mastergolf.cn")
#define VERSION  [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]

#else

// 测试版服务器
//#define SERVER_PREFIX   (@"http://sheying.development.mastergolf.cn")
//#define SERVER_PREFIX   (@"http://192.168.3.115:3000")
#define SERVER_PREFIX   (@"http://sheying.development.mastergolf.cn")
#define VERSION  [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]

#endif


#define SERVER_URL(url)          ([NSString stringWithFormat:@"%@%@",SERVER_PREFIX,url])

/********************MatchModules********************/

#define MoveAnimationDuration   0.3

#define NAVIGATIONBAR_IMAGE PCImage(@"NavigationRedBackGround")
//UIStatusBarStyle
#define GMStatusBarStyle UIStatusBarStyleLightContent

/********************Modules********************/

//时间字体
#define TEXTSIZE_TIME 15.0
//标题字体
#define TEXTSIZE_TITLE 20.0
//小字体
#define TEXTSIZE_SMALL 18.0
//大字体
#define TEXTSIZE_LARGE 22.0

/*API COMMON definition*/
#define API_KEY_RESPONSE_CODE               @"code"
#define API_KEY_RESPONSE_DATA               @"data"
#define API_KEY_RESPONSE_STATUS             @"status"

#define API_RESPONSE_OK                       10000
#define API_RESPONSE_OK_NOCHANGE              10001
#define API_RESPONSE_INVALIDTOKEN             -10101 //token失效
#define API_RESPONSE_LESS                     80001
#define API_RESPONSE_REPEATAPPLAUD            50201
#define API_RESPONSE_REPEATOPERATE            70006
#define API_RESPONSE_REPEATACCEPT             70003
#define API_RESPONSE_MISSINGPARAMETERS        20006

#define API_RESPONSE_VERIFICATIONCODE_EXPIRED 30105//验证码过期
#define API_RESPONSE_INVALIDPHONENUM          30101//无效的手机号码
#define API_RESPONSE_UNKNOWNPHONENUMBER       30103//未知的手机号（手机号未注册）
#define API_RESPONSE_VERIFICATIONCODE_ERROR   30104//验证码错误
#define API_RESPONSE_VERIFICATIONCODE_INVALID 30102//验证码无效

#define API_RESPONSE_VERIFICATIONCODE_REQUESTMORE 30107//验证码请求次数过多
#define API_RESPONSE_PASSWORDERROR  30109//账户密码错误
#define API_RESPONSE_NOTSETPASSWORD 30110//未设置密码
#define API_RESPONSE_UNREGISTERED 30113//账户未注册
#define API_RESPONSE_REGISTERED   -10105//账户已注册

// 判断IOS版本
#define iOS(v) (([[[UIDevice currentDevice] systemVersion] doubleValue] >= (v))? YES:NO)

// 回调通知名
#define ALIPAY_NOTIFICATION_NAME   @"alipay"
#define PHOTOCOMMENTCOUNT_NOTIFICATION_NAME @"photoCommentCount"

#define UserDefaults                       \
[NSUserDefaults standardUserDefaults]
#define UserDefaults_Save                  \
[UserDefaults synchronize]

#define UserDefaults_GetBool(KEY)          \
[UserDefaults boolForKey:(KEY)]
#define UserDefaults_SetBool(bool,KEY)     \
[UserDefaults setBool:(bool) forKey:(KEY)];UserDefaults_Save;

#define UserDefaults_GetObject(KEY)        \
[UserDefaults objectForKey:(KEY)]
#define UserDefaults_SetObject(OBJECT,KEY) \
[UserDefaults setObject:(OBJECT) forKey:(KEY)];UserDefaults_Save;

#define UserDefaults_RemoveObject(KEY)     \
[UserDefaults removeObjectForKey:(KEY)];UserDefaults_Save;

#endif
